﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

public partial class XGmima : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }


    protected void Button1_Click1(object sender, EventArgs e)
    {
        string oldps = TextBox1.Text.ToString().Trim();
        string newps = TextBox2.Text.ToString().Trim();
        string psagain = TextBox3.Text.ToString().Trim();
        users us = new users();
        us.p_oldps = oldps;
        us.p_password  = newps;
        string p_id;
        p_id = Session["man_m_id"].ToString();
        us.p_id  = p_id;
        int i = 0;
        i = us.password (us);
        if (i > 0)
        {
            us.updataps (us);
            Response.Write("<script>alert(\"恭喜你，修改成功！\")</script>");
        }
        else
        {
            Response.Write("<script>alert(\"修改失败，原密码错误！\")</script>");
        }
    }
}